<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">
    <p:dialog id="dlgSeidaRequest"
              header="#{messages.label_titulo_informacion}"
              modal="true" widgetVar="wvSeidaRequest" resizable="true"
              dynamic="true" width="750">
        <p:outputPanel id="pnlSeidaRequest">
            <h:panelGrid columns="1" styleClass="centered">
                <h:form>
                    <p:commandButton value="Descargar archivo" rendered="#{fnEnviosJsfBean.sunatRequestMgr.showDownloadFile}"
                                     ajax="false" immediate="true" onclick="PrimeFaces.monitorDownload(start, stop)"
                                     icon="ui-icon-arrowthick-1-s" style="width: 120px;">
                        <p:fileDownload value="#{fnEnviosJsfBean.downloadFileRequest}" />
                    </p:commandButton>
                    <p:panel id="pnlBlList" toggleable="false"
                             styleClass="gridContent" >
                        <f:facet name="header">
                            <h:outputText value="Listado de Bl's"/>
                        </f:facet>
                        <h:outputText value=" (Registros : #{sunatRequestMgr.blListSize}) "
                                      styleClass="resultHeader"/>
                        <p:dataTable id="dttWarning" value="#{sunatRequestMgr.blList}"
                                     var="item"
                                     style="width:100%"
                                     paginator="true"
                                     rows="10"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     rowsPerPageTemplate="5,10,15">
                            <p:column styleClass="columnLeftTopClass"
                                      style="min-width:100px; max-width:100px">
                                <f:facet name="header">
                                    <h:outputText value="Bl - Det"/>
                                </f:facet>
                                <h:outputText value="#{item.numeroBL}-#{item.numeroDetalle}"/>
                            </p:column>
                            <p:column styleClass="columnLeftTopClass"
                                      style="min-width:100px; max-width:100px">
                                <f:facet name="header">
                                    <h:outputText value="Contenedor"/>
                                </f:facet>
                                <h:outputText value="#{item.contenedorId}"/>
                            </p:column>
                            <p:column styleClass="columnRighTopClass"
                                      style="min-width:50px; max-width:60px">
                                <f:facet name="header">
                                    <h:outputText value="Bultos"/>
                                </f:facet>
                                <h:outputText value="#{item.cantidadBultos}">
                                    <f:convertNumber pattern="###,###,##0" locale="en-US"/>
                                </h:outputText>
                            </p:column>
                            <p:column styleClass="columnRighTopClass"
                                      style="min-width:60px; max-width:80px">
                                <f:facet name="header">
                                    <h:outputText value="Peso Bruto"/>
                                </f:facet>
                                <h:outputText value="#{item.pesoBruto}">
                                    <f:convertNumber pattern="###,###,##0.00" locale="en-US"/>
                                </h:outputText>
                            </p:column>
                            <p:column styleClass="columnRighTopClass"
                                      style="min-width:60px; max-width:80px">
                                <f:facet name="header">
                                    <h:outputText value="Peso Carga"/>
                                </f:facet>
                                <h:outputText value="#{item.pesoCarga}">
                                    <f:convertNumber pattern="###,###,##0.00" locale="en-US"/>
                                </h:outputText>
                            </p:column>
                            <p:column styleClass="columnLeftTopClass"
                                      style="min-width:150px; max-width:250px">
                                <f:facet name="header">
                                    <h:outputText value="Precintos"/>
                                </f:facet>
                                <h:outputText value="#{item.sealNbr1}"/>
                            </p:column>
                        </p:dataTable>
                    </p:panel>
                </h:form>
            </h:panelGrid>
            <h:panelGrid columns="1" styleClass="centered">
                <p:commandButton value="#{messages.label_aceptar}"
                                 onclick="wvSeidaRequest.hide()"/>
            </h:panelGrid>
        </p:outputPanel>
    </p:dialog>

</ui:composition>
